<%--
  Created by IntelliJ IDEA.
  User: chenli
  Date: 2017/3/22
  Time: 10:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
    <link rel="stylesheet" href="<%=basePath %>/css/list.css">
    <link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />


    <script src="<%=basePath %>js/jquery.min.js"></script>
    <link rel="stylesheet" href="<%=basePath %>lib/icheck/icheck.css">
    <script src="<%=basePath %>lib/My97DatePicker/WdatePicker.js"></script>
    <script src="<%=basePath %>lib/icheck/jquery.icheck.min.js"></script>
    <script src="<%=basePath %>lib/bootstrap-modal/2.2.4/bootstrap-modalmanager.js"></script>
    <script src="<%=basePath %>lib/bootstrap-modal/2.2.4/bootstrap-modal.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=basePath %>/css/simditor.css" />
    <script type="text/javascript" src="<%=basePath %>/js/module.js"></script>
    <script type="text/javascript" src="<%=basePath %>/js/hotkeys.js"></script>
    <script type="text/javascript" src="<%=basePath %>/js/uploader.js"></script>
    <script type="text/javascript" src="<%=basePath %>/js/simditor.js"></script>
    <script type="text/javascript" src="<%=basePath %>js/H-ui.js"></script>

    <script type="text/javascript">
        function check(f) {
            if(f.imgName.value.replace(/\s/g,'') == ''){
                alert("图片名称不能为空");
                return false;
            }
            if('${type}'=='add'){
                if(f.imgFile.value.replace(/\s/g,'') == ''){
                    alert("图片路径不能为空");
                    return false;
                }
            }


            return true;
        }
    </script>
</head>
<body>
<div class="connect_wrap">
    <h3 style= "text-align: center;">图片维护</h3>
    <div class="row cl" style="max-width:88%;margin-left:8%;">
        <div class="labelText"></div>
        <form action="<%=basePath %>/activityImg/activityImgEdit" method="post" onsubmit="return check(this)"
              enctype="multipart/form-data" >
            <div class="col-sm-4"></div>
            <div class="col-sm-4">
                <div class="boxs">
                    <c:if test="${type eq 'upd'}">
                        <input type="text" class="inputBox" name="id" value="${img.id}" placeholder="编号" readonly="readonly" >
                    </c:if>
                    <input type="text" class="inputBox" name="imgName" id="imgName" value="${img.imgName}" placeholder="图片名称">
                    <input type="file" class="inputBox" placeholder="图片地址" name="imgFile" value="${img.imgUrl}" >
                    <textarea id="remark" class="textareaBox" name="remark" placeholder="图片说明 ">${img.remark}</textarea>
                    <select id="status" name="status" class="selectBox"  >
                        <option value="">活动图片状态</option>
                        <option value="1" ${img.status == 1 ? 'selected="seelcted"' : '' }>启用</option>
                        <option value="0" ${img.status == 0 ? 'selected="seelcted"' : '' }>停用</option>
                    </select>
                    <input type="submit"  class="true" value="提交">
                    <input type="button"  class="false" value="取消" onclick="window.history.go(-1)">

                </div>
            </div>
        </form>
    </div>
</div>
</body>

<script src="<%=basePath %>/js/formsJS.js"></script>
<script>
    $(function(){
        editor = new Simditor({
            textarea: $('textarea[name="content"]')
        });


    });

</script>

</html>

